import { createStore } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'

export default createStore({
  state: {
    menuColor:'background-color: #00152a',
    token:'',
  },
  plugins:[
      createPersistedstate({
        key:'vuex',
        storage:window.sessionStorage,
      })
  ],
  getters: {
  },
  mutations: {
    updateInfo(state, payload) {

      state.info = payload;

    }
  },
  actions: {
    updateInfoSaync(context, payload) {

      //               同步方法	  内容
      context.commit('updateInfo', payload);

    }
  },
  modules: {
  }
})
